package com.sense.kukoo.biz_me.view

import com.alibaba.android.arouter.facade.annotation.Route
import com.gyf.immersionbar.ImmersionBar
import com.sense.kukoo.biz_me.R
import com.sense.kukoo.biz_me.databinding.BizMeActivityMyHistoryBinding
import com.sense.kukoo.biz_me.vm.MyHistoryViewModel
import com.sense.kukoo.common.anim.BottomMotionAnimHelper
import com.sense.kukoo.common.constant.ARouterUrl
import com.sense.kukoo.common.mvvm.view.BaseMvvmActivity
import com.sense.kukoo.common.utils.ApplicationContext

@Route(path = ARouterUrl.ROUTE_ME_MODULE_MY_HISTORY_ACTIVITY)
class MyHistoryActivity: BaseMvvmActivity<MyHistoryViewModel, BizMeActivityMyHistoryBinding>(){

    private val TAG: String = javaClass.simpleName
    private val mAnimHelper = BottomMotionAnimHelper()

    override fun responseVM(action: Int) {}

    override fun getLayoutId(): Int = R.layout.biz_me_activity_my_history

    override fun getViewModelClass(): Class<MyHistoryViewModel> = MyHistoryViewModel::class.java

    override fun initStatusBar() {
        ImmersionBar.with(this)
            .transparentStatusBar()
            .navigationBarColor(com.sense.kukoo.common_design.R.color.bg_background)
            .statusBarDarkFont(true)
            .navigationBarDarkIcon(true)
            .fitsSystemWindows(false)
            .init()
    }

    override fun initData() {
        mBinding.lifecycleOwner = this
        mBinding.vm = mViewModel
    }

    override fun initView() {
        //弹出动画
        val first = ApplicationContext.dp2px(800F).toFloat()
        mAnimHelper.init(mBinding.flMyHistoryRoot, mBinding.clMyHistoryContentRoot, first){ finish() }
        mAnimHelper.animateToStart()
    }
}